package factory.abstractfactory;

public class PizzaStore {
    public void purchase(String loc, String type) {
        OrderPizza orderPizza = new OrderPizza();
        if (loc.equalsIgnoreCase("bj")) {
            orderPizza.setFactory(new BJFactory());
            orderPizza.orderPizza(type);
        } else if (loc.equalsIgnoreCase("ld")) {
            orderPizza.setFactory(new LDFactory());
            orderPizza.orderPizza(type);
        } else {
            System.out.println("没有" + loc + "生产的披萨");
        }

    }
}
